package com.shushan.ui;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.VideoView;

/**
 * @ClassName: FullScreenVideoView
 * @Desciption: //全屏视频播放类
 * @author: zhangshihao
 * @date: 2018-04-03
 */
public class WrapContentVideoView extends VideoView {

    public WrapContentVideoView(Context context) {
        super(context);
    }

    public WrapContentVideoView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public WrapContentVideoView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        int widthSize = getDefaultSize(0, widthMeasureSpec);
        int heightSize = getDefaultSize(0, heightMeasureSpec);
        setMeasuredDimension(widthSize,heightSize);
    }
}
